<template>
  <view>
    <button @click="showPopup">点击弹出</button>
    <uni-popup ref="popupRef" type="bottom">
      <view> 弹出层</view>
      <button @click="closePopup">关闭弹出层</button>
    </uni-popup>
    <button @click="openPayment">打开支付弹窗</button>
    <custom-payment :order-id="'888'" :amount="99" ref="customPaymentRef"></custom-payment>
  </view>
</template>
<script lang="ts" setup>
  import { ref } from 'vue'
  // import CustomPayment from './components/custom-payment.vue'
  import type { CustomPaymentInstance } from '@/types/components'
  const popupRef = ref<UniHelper.UniPopupInstance>()
  const showPopup = () => {
    popupRef.value?.open?.()
  }
  const closePopup = () => {
    popupRef.value?.close?.()
  }
  const customPaymentRef = ref<CustomPaymentInstance>()
  const openPayment = () => {
    customPaymentRef.value?.open()
  }


</script>
<style></style>
